home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
misc
/
football
/
user
/
fixturesleft.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-29
|
4KB
|
161 lines
/* Mode=Run */
/* ***********************************************************************
DISPLAY FIXTURES LEFT PROGRAM FOR FOOTBALL REXX SUITE
-------------------------------------------------------
Copyright Mark Naughton 1998
Version Date History
--------------------------------------------------------------------------
1.0 140498 First release.
1.1 050599 Updated to handle odd number of times each team is
played - displays a message; but only if its not
scheduled using a schedule file.
250899 Added error msg for file checks.
280899 Converted to use locale. Some error messages, before
reading the locale, will still be in English.
**************************************************************************
Procedure
---------
1. Check files exist. Read '.df' file for schedule and numplay settings.
2. Open Teams.sf datafile. Get league name.
3. Search for unplayed matches and store.
4. Print the matches and exit...
************************************************************************** */
PARSE ARG league_stuff
version = 1
input_file = '.sf'
input2_file = '.df'
separator = '*'
separator2 = '**'
games. = '???'
mtch = 0
not_played = '__ __'
autosched = "*AUTOSCHD="
autos = 0
numplay = 0
oddnums = "1 3 5 7 9"
parse var league_stuff league_file
league_file = "Data/" || league_file
if open(datafile,"Data/Football.locale",'r') then do
line = readln(datafile)
locdir = strip(line)
close(datafile)
end
else do
say
say "ERROR : (FixturesLeft)"
say
say "Cannot read 'Data/Football.locale' for the locale settings."
exit
end
locdir = locdir"User/FixturesLeft.data"
if open(datafile,"ENV:FootballRXPath",'r') then do
line = readln(datafile)
rxdir = strip(line)
close(datafile)
end
else
rxdir = "SYS:Rexxc/"
if exists(locdir) > 0 then do
address command rxdir'rx 'locdir
VarCount = getclip('VarCount')
do i = 1 to VarCount
interpret getclip('var.'i)
end
end
else do
say
say "ERROR : (FixturesLeft)"
say
say "Cannot find '"locdir"' to read locale settings."
exit
end
if exists(league_file || input_file) = 0 then do
say
say fl_error
say
say fl_one"'"league_file || input_file"'."
exit
end
if exists(league_file || input2_file) = 0 then do
say
say fl_error
say
say fl_one"'"league_file || input2_file"'."
exit
end
if open(datafile2,league_file || input2_file,'r') then do
do while ~eof(datafile2)
line = readln(datafile2)
if pos(playeo,line) > 0 then
numplay = delstr(line,1,12)
if pos(autosched,line) > 0 then
autos = 1
end
close(datafile2)
end
else do
say
say fl_error
say
say fl_two"'"league_file || input2_file"'."
exit
end
if open(datafile,league_file || input_file,'r') then do
do while ~eof(datafile)
line = readln(datafile)
if pos(separator2,line) > 0 then
league_title = delstr(line,1,3)
if pos(not_played,line) > 0 then do
mtch = mtch + 1
games.mtch = line
end
end
close(datafile)
end
else do
say
say fl_error
say
say fl_three"'"league_file||input_file"'"fl_four
exit
end
say
say center("'"league_title"'",78)
say "-------------------------------------------------------------------------------"
say
if autos = 0 & pos(numplay,oddnums) > 0 then do
say fl_txt1
say fl_txt2
say fl_txt3
say
end
say fl_txt4""mtch
say
do i=1 to mtch
say games.i
end
say
say
say "-------------------------------------------------------------------------------"
say
exit